﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Net.Mail;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //
        Response.Write(Environment.Version);

        new WebClient().DownloadFile("http://baidu.com", HttpRuntime.AppDomainAppPath + "a.html");


    }
    protected void Button1_Click(object sender, EventArgs e)
    {
        // new WebClient().DownloadFile(TextBox1.Text.Trim(), HttpRuntime.AppDomainAppPath + TextBox2.Text.Trim());
        SmtpClient sc = new SmtpClient("smtp.163.com");
        sc.Credentials = new NetworkCredential("userName", "password");
        MailMessage mm = new MailMessage("from@163.com", "to@qq.com");
        mm.Subject = "";

        Attachment tt = new Attachment(HttpRuntime.AppDomainAppPath + "a.txt");
        mm.Attachments.Add(tt);

        sc.Send(mm);
    }
}